﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using JYH.Data;
namespace JYH.Model
{

    /// <summary>
    ///  WmsStocktakeOrderInfo
    /// </summary> 
    [TableName("WmsStocktakeOrderInfo")]
    [PrimaryKey("StocktakeID", autoIncrement = false)]
    public class WmsStocktakeOrderInfo
    {

        /// <summary>
        /// 盘点单ID
        /// </summary>
        [Column]
        public string StocktakeID { get; set; }

        /// <summary>
        /// 盘点单号
        /// </summary>
        [Column]
        public string StocktakeNO { get; set; }

        /// <summary>
        /// 仓库编号
        /// </summary>
        [Column]
        public string WarehouseNO { get; set; }

        /// <summary>
        ///盘点卡号
        /// </summary>
        [Column]
        public string ErpOrderNO { get; set; }

        /// <summary>
        ///盘点类型
        /// </summary>
        [Column]
        public string TakeType { get; set; }

        /// <summary>
        /// 盘点卡日期
        /// </summary>
        [Column]
        public string TakeDate { get; set; }
 
/// <summary>
/// 盘点单状态 0 编辑 1 审核(以后的状态就无法从ERP同步数据) 2 初盘 3 复盘 4 终盘 5 结束 6 回抛  
/// </summary>
[Column]
    public string RState { get; set; }

        /// <summary>
        ///  盘点单状态 0 编辑 1 审核(以后的状态就无法从ERP同步数据) 2 初盘 3 复盘 4 终盘 5 结束 6 回抛 
        /// </summary>
        [ResultColumn]
        public string RStateName
        {
            get
            {
                switch (RState)
                {
                    default:return "Unknown";
                    case "0":return "Waiting";
                    case "1": return "Checked";
                    case "2": return "First";
                    case "3": return "Second";
                    case "4": return "Last";
                    case "5": return "Finished";
                    case "6": return "Upload";

                }
            }
        }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column]
        public string CreateTime { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column]
        public string CreateUser { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [Column]
        public string UpdateTime { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [Column]
        public string UpdateUser { get; set; }

        /// <summary>
        /// 完成时间
        /// </summary>
        [Column]
        public string FinishTime { get; set; }

        /// <summary>
        /// 完成人员
        /// </summary>
        [Column]
        public string FinishUser { get; set; }

        /// <summary>
        /// 回抛时间
        /// </summary>
        [Column]
        public string UploadTime { get; set; }

        /// <summary>
        /// 回抛人员
        /// </summary>
        [Column]
        public string UploadUser { get; set; }


        /// <summary>
        /// 盘点物料明细
        /// </summary>
        [ResultColumn]
        public List<WmsStocktakeMaterial> TakeMaterials { get; set; }

        /// <summary>
        /// 盘点条码明细
        /// </summary>
        [ResultColumn]
        public List<WmsStocktakeBarcode> TakeBarcodes { get; set; }

        [ResultColumn]
        public int PageIndex { get; set; } = 1;

        [ResultColumn]
        public int PageSize { get; set; } = 10;


        //public int PageIndex { get; set; }
        //public int PageSize { get; set; }
        //public string StocktakeNO { get; set; }  // 确保和 JSON 的字段名一致
        //public string WarehouseNO { get; set; }
        //public string TakeType { get; set; }
    }

}
